
import request from '@/utils/request'

/**
 * 列表
 * @param params
 * @returns {AxiosPromise}
 */
export function list(params) {
  return request({
    url: '/admin/maintenance_plan',
    method: 'get',
    params
  })
}



/**
 * 列表
 * @param params
 * @returns {AxiosPromise}
 */
export function init_data(params) {
    return request({
      url: '/admin/maintenance_init',
      method: 'get',
      params
    })
  }


/**
 * 详情
 * @param id
 * @returns {AxiosPromise}
 */
 export function detail(id) {
    return request({
      url: `/admin/maintenance_plan_detail?id=`+id,
      method: 'get',
    })
  }

  /**
 * 删除
 * @param id
 * @returns {AxiosPromise}
 */
export function del(id) {
    return request({
      url: `/admin/maintenance_plan_delete`,
      method: 'post',
      data:{
        ids:id
      }
    })
  }


  /**
 * 创建
 * @param data
 * @returns {AxiosPromise}
 */
export function create(data) {
    return request({
      url: '/admin/maintenance_plan_create',
      method: 'post',
      data
    })
  }


      /**
 * 编辑
 * @param data
 * @returns {AxiosPromise}
 */
export function edit(data) {
  return request({
    url: '/admin/maintenance_plan_edit',
    method: 'post',
    data
  })
}

      /**
 * 开关
 * @param data
 * @returns {AxiosPromise}
 */
export function equipment_switch(data) {
    return request({
        url: '/admin/maintenance_plan_status',
        method: 'post',
        data
    })
}




